599924c9af54b4435bb0a2b4f960b7e91f1e200b,unison/unison-server-core/src/main/java/com/tremolosecurity/provisioning/core/WorkflowImpl.java,WorkflowImpl,executeWorkflow,#AuthInfo#String#,528
Before Change
HashMap<String,Object> params = new HashMap<String,Object>();
params.put(ProvisioningParams.UNISON_EXEC_TYPE, ProvisioningParams.UNISON_EXEC_SYNC);
this.executeWorkflow(user,params);
try {
if (user.isResync()) {
After Change
Map<String,Object> params = new HashMap<String,Object>();
params.put(ProvisioningParams.UNISON_EXEC_TYPE, ProvisioningParams.UNISON_EXEC_SYNC);
params = this.executeWorkflow(user,params);
try {
if (user.isResync()) {
StringBuffer b = new StringBuffer();
b.append("(").append(uidAttr).append("=").append(user.getUserID()).append(")");
String root = null;
AuthChainType act = this.cfgMgr.getAuthChains().get(authInfo.getAuthChain());
root = (String) params.get(ProvisioningParams.UNISON_RESYNC_ROOT);
if (root == null) {
if (act != null) {
root = act.getRoot();
}
if (root == null) {
root = this.cfgMgr.getCfg().getLdapRoot();
}
}
LDAPSearchResults res = this.cfgMgr.getMyVD().search(root, 2, equal(uidAttr,user.getUserID()).toString(), new ArrayList<String>());
if (res.hasMore()) {
if (! user.keepExternalAttrs) {
authInfo.getAttribs().clear();
}
LDAPEntry entry = res.next();
authInfo.setUserDN(entry.getDN());
Iterator<LDAPAttribute> it = entry.getAttributeSet().iterator();
while (it.hasNext()) {
LDAPAttribute attrib = it.next();
Attribute attr = new Attribute(attrib.getName());
String[] vals = attrib.getStringValueArray();
for (int i=0;i<vals.length;i++) {
attr.getValues().add(vals[i]);
}
authInfo.getAttribs().put(attr.getName(), attr);
}
} else {
throw new ProvisioningException("User " + authInfo.getUserDN() + " does not exist" );
}
}
} catch (Exception e) {
throw new ProvisioningException("Could not reload user",e);
}
return params;
}